﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UDDL.Model
{
	public class Entity : Item, IType
	{
		internal Entity(Namespace parent, String name)
			: base(name)
		{
			Parent = parent;
			Properties = new List<Property>();
		}

		public Property AddProperty(String name, String typeName)
		{
			Item item = GetSubItem(name);
			if (item != null)
				return null;
			Property property = new Property(this, name, typeName);
			AddSubItem(property);
			Properties.Add(property);
			return property;
		}


		public Namespace Parent { get; internal set; }
		public List<Property> Properties { get; private set; }
	}
}
